import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import * as Rx from 'rxjs';

@Injectable({
	providedIn: 'root',
})
export class ProfileService {
	constructor(private http: HttpClient) {}
	profile$ = this.http.get<Profile>('/api/profile').toPromise();
	
	public resetPassword(data) {
		return this.http.post(`/api/user/find_password`, data).toPromise();
	}

	/**
	 * resetPassword
	 */
	public receiveCaptcha(mobileno: string) {
		return this.http.get(`/api/user/smscode?phone=${mobileno}`).toPromise();
	}
}
interface Profile {
	admin_total: number;
	picture_space_usage: number;
	launched_at: number;
	upgraded_at: number;
	expired_at: number;
	name: string;
	version: string;
	logo: string;
	favicon: string;
	grantee: string;
	company_name: string;
}
